package com.techsoul.module.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.techsoul.module.system.pojo.entity.Attachment;
import com.techsoul.module.system.pojo.param.AttachmentSaveParam;
import com.techsoul.module.system.pojo.param.AttachmentSearchParam;
import com.techsoul.module.system.pojo.vo.AttachmentVo;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import java.io.InputStream;
import java.util.List;

/**
 * 附件 Service接口
 *
 * @author liuen
 * @date 2021-06-03
 */
public interface IAttachmentService {

    /**
     * 新增
     * @param params
     * @return
     */
    String insert(AttachmentSaveParam params);

    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete(String id);

    /**
     * 批量删除
     * @param idList
     */
    Integer batchDelete(List<String> idList);

    /**
     * 修改
     * @param params
     * @return
     */
    Integer update(AttachmentSaveParam params);

    /**
     * 详情
     * @param id
     * @return
     */
    AttachmentVo findById(String id);

    /**
     * 列表
     * @param params
     * @return
     */
    List<AttachmentVo> findAll(AttachmentSearchParam params);

    /**
     * 列表-分页
     * @param params
     * @param current
     * @param pageSize
     * @return
     */
    IPage<AttachmentVo> findAll(AttachmentSearchParam params, Integer current, Integer pageSize);

    /**
     * 上传附件
     * @param request
     * @return
     */
    List<Attachment> upload(MultipartHttpServletRequest request);

}
